﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <%= TempData["Message"]%>
    <%using (Html.BeginForm("ChangePassword", "UserAdmin", FormMethod.Post, new { id = "addForm", @class = "form" }))
      {%>
    <script type="text/javascript">
    var i = 0;
    $(document).ready(function () {
        $("#addForm").validate({
            debug: false,
            errorElement: "span",
            errorPlacement: function (error, element) {
                error.tooltip({
                    bodyHandler: function () {
                        return error.html();
                    }
                });
                error.insertAfter(element);
            },
            rules: {
                UserName: {
                    required: true
                },
                Password: {
                    required: true,
                    minlength: 6
                },
                ConfirmPassword: {
                    required: true,
                    minlength: 6,
                    equalTo: "#Password"
                }
            },
            messages: {			    
			    ConfirmPassword: {				    
				    equalTo: "Vui lòng điền vào mật khẩu như ở trên"
			    },			  
		    },
            submitHandler: function (form) {
                if (i == 0) {
                    form.submit();
                    i++;
                }
            }
        });        
    });
    </script>
    <table width="50%" border="0" cellpadding="0" cellspacing="0" class="edit">
        <tr>
            <td class="label required" style="width: 150px">
                Tên Người Dùng<span>*</span>
            </td>
            <td class="input">
                <% Response.Write(Html.TextBox("UserName", ((UserAdmin)ViewData.Model).UserName, new
                   {
                       @maxlength = "40",
                       @style = "width:200px",
                       @readonly = true
                   }));
                   Response.Write(Html.Hidden("UserAdminId", ((UserAdmin)ViewData.Model).UserAdminId));
                   Response.Write(Html.Hidden("FromMemu", ViewData["IsFromMenu"]));
                %>
            </td>
        </tr>
        <tr>
            <td class="label required">
                Mật Khẩu Mới<span>*</span>
            </td>
            <td class="input">
                <% Response.Write(Html.TextBox("Password", "", new
               {
                   @maxlength = "40",
                   @style = "width:200px",
                   @type = "password"
               })); %>
            </td>
        </tr>
        <tr>
            <td class="label required">
                Xác Nhận Mật Khẩu Mới<span>*</span>
            </td>
            <td class="input">
                <% Response.Write(Html.TextBox("ConfirmPassword", "", new
               {
                   @maxlength = "40",
                   @style = "width:200px",
                   @type = "password"
               })); %>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <input type="submit" class="save" value="" alt="Update" />
                <input type="button" class="cancel" value="" alt="" onclick="JS_LIB.back()" />
            </td>
        </tr>
    </table>
    <%}%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PageTitle" runat="server">
    Đổi Mật Khẩu - Thẻ Sinh Viên
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ModuleName" runat="server">    
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="FunctionTitle" runat="server">
    Đổi Mật Khẩu
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="LoginRoles" runat="server">
</asp:Content>
